# File: buff.gd
class_name Buff
extends Resource
## 状态效果数据容器


var base_duration: float = 5.0 ## 基础持续时间（秒）
var source: Unit = null ## 效果来源单位
var buff_type: int = GameConstant.BUFF_TYPE.BUFF ## 效果类型枚举值
var effect_power: float = 0.0 ## 效果强度值
var max_stacks: int = 1 ## 最大叠加层数

var final_duration: float: ## 最终持续时间
	get: return floor(base_duration * (1.0 + source.status_duration_bonus)) if source else base_duration


func _init(duration: float, type: int, src: Unit, power: float = 0.0, stacks: int = 1):
	base_duration = duration
	buff_type = type
	source = src
	effect_power = power
	max_stacks = stacks